import React,{Component} from 'react';
import {Text} from 'react-native';

export default class Demo06Component extends Component{

  constructor(){
    super();
    this.state = {
      opacityValue:0
    }
  }

  componentDidMount(){
    setInterval(()=>{
      var nowValue = this.state.opacityValue;
      
      nowValue+=0.1;

      if(nowValue > 1){
        nowValue = 0;
      }
      this.setState(  
        {opacityValue:nowValue}
      );
    },500);
  }

  render(){
    return <Text style=
    {{opacity:this.state.opacityValue}}>Hello RN</Text>
  }
}